<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>{{msg}}</h1>
    <button @click="num = 1">新闻</button>
    <button @click="num = 2">体育</button>
    <button @click="num = 3">娱乐</button>
    <p v-show="num == 1">新闻</p>
    <p v-show="num == 2">体育</p>
    <p v-show="num == 3">娱乐</p>
  </div>
  <script>
    Vue.config.productionTip = false;
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          msg: "hello vue!",
          num: null
        }
      },
      methods: {}
    })
  </script>
</body>

</html>